package com.duobaoyu.dby.supply.api.remote.feign;

import com.duobaoyu.dby.common.core.constant.SecurityConstants;
import com.duobaoyu.dby.common.core.util.R;
import com.duobaoyu.dby.supply.common.biz.remote.dto.refund.*;
import com.duobaoyu.dby.supply.common.biz.remote.to.refund.*;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;


/**
 * @author liyang
 * @version 1.0.0
 * @ClassName RemoteSupplyChainAfterSaleService
 * @Description 售后
 * @createTime 14:18:00 2022/06/09
 */
@FeignClient(contextId = "remoteSupplyChainBizAfterSaleService", value = "dby-supply-chain-biz-api")
public interface RemoteSupplyChainBizAfterSaleService {

	@ApiOperation("批量查询商品售后权益")
	@PostMapping("/api/after-sale/attributes")
	R<AfterSaleAttributesTO> queryAfterSaleAttributes(@RequestBody AfterSaleAttributesDTO afterSaleAttributes, @RequestHeader(SecurityConstants.FROM) String from);

	@ApiOperation("售后申请")
	@PostMapping("/api/after-sale/apply")
	R<ApplyAfterSaleTO> applyAfterSale(@RequestBody AfterSaleApplyDTO afterSaleApply, @RequestHeader(SecurityConstants.FROM) String from);

	@ApiOperation("查询客户寄回地址")
	@PostMapping("/api/after-sale/address")
	R<AfterSaleAddressTO> queryAfterSaleAddress(@RequestBody AfterSaleAddressDTO afterSaleAddress, @RequestHeader(SecurityConstants.FROM) String from);

	@ApiOperation("填写运单信息")
	@PostMapping("/api/after-sale/wayBill")
	R<AfterSaleWayBillTO> createAfterSaleWayBill(@RequestBody AfterSaleWayBillDTO afterSaleWayBill, @RequestHeader(SecurityConstants.FROM) String from);

	@ApiOperation("取消售后申请")
	@PostMapping("/api/after-sale/cancel")
	R<CancelAfterSaleApplyTO> cancelAfterSaleApply(@RequestBody CancelAfterSaleDTO cancelAfterSale, @RequestHeader(SecurityConstants.FROM) String from);

	@ApiOperation("确认售后服务")
	@PostMapping("/api/after-sale/confirm")
	R<ConfirmAfterSaleTO> confirmAfterSale(@RequestBody ConfirmAfterSaleDTO confirmAfterSale, @RequestHeader(SecurityConstants.FROM) String from);

	@ApiOperation("查询售后物流（自行寄件支持物流）")
	@PostMapping("/api/after-sale/logistics")
	R<AfterSaleLogisticsTO> queryAfterSaleLogistics(@RequestBody AfterSaleLogisticsDTO afterSaleLogistics, @RequestHeader(SecurityConstants.FROM) String from);

	@ApiOperation("上传售后凭证")
	@PostMapping(value = "/api/after-sale/uploadAfterSaleVoucher/{orderSn}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
	R<String> uploadAfterSaleVoucher(@PathVariable("orderSn") String orderRealSn, @RequestPart("file") MultipartFile file, @RequestHeader(SecurityConstants.FROM) String from);

	@ApiOperation("售后回查接口")
	@GetMapping("/api/after-sale/query")
	R<ApplyAfterSaleDetailTO> afterSaleQuery(@SpringQueryMap AfterSaleQueryDTO afterSaleQuery, @RequestHeader(SecurityConstants.FROM) String from);
}
